//进行某一个模块的权限判断
import { useStore } from "@/store";

export function userPremission(pageName: string, handleName: string) {
  const store = useStore();
  const permission = store.state.login.permission;
    // 将menu 里面的权限，取出来进行存储，然后将所需要验证权限的页面和操作作为参数传递过来进行比较
  const verifyPermission = `system:${pageName}:${handleName}`;
  return !!permission.find((item) => item === verifyPermission);
}
